function [Stage] = ClassifierForStage3and4(Frequency, Amplitude, FreqThreshold, AmpThreshold, PercentThresholdUpper, PercentThresholdLower)

    count = 0;
    
    for i = 1 : length(Frequency)
        if Frequency(i) <= FreqThreshold && Amplitude(i) > AmpThreshold
            count = count + 1;
        end
    end
       
    if count/length(Frequency) > PercentThresholdLower/100 && count/length(Frequency) < PercentThresholdUpper/100
        Stage = 3;
    elseif count/length(Frequency) > PercentThresholdUpper/100
        Stage = 4;
    else
        Stage = -1;
    end
end